package com.bootdo.appsystem.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.bootdo.appsystem.dao.UsershouruDao;
import com.bootdo.appsystem.domain.UsershouruDO;
import com.bootdo.appsystem.service.UsershouruService;



@Service
public class UsershouruServiceImpl implements UsershouruService {
	@Autowired
	private UsershouruDao usershouruDao;
	
	@Override
	public UsershouruDO get(Integer id){
		return usershouruDao.get(id);
	}
	
	@Override
	public List<UsershouruDO> list(Map<String, Object> map){
		return usershouruDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return usershouruDao.count(map);
	}
	
	@Override
	public int save(UsershouruDO usershouru){
		return usershouruDao.save(usershouru);
	}
	
	@Override
	public int update(UsershouruDO usershouru){
		return usershouruDao.update(usershouru);
	}
	
	@Override
	public int remove(Integer id){
		return usershouruDao.remove(id);
	}
	
	@Override
	public int batchRemove(Integer[] ids){
		return usershouruDao.batchRemove(ids);
	}

	@Override
	public UsershouruDO getByUid(Integer uid) {
		Map<String, Object> map = new HashMap<>();
		map.put("uid",uid);
        List<UsershouruDO> list = this.list(map);
        if(list.size() > 0){
            return list.get(0);
        }
        return null;
	}

}
